
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <base href="/">
  <meta charset="utf-8">
  <title>找回密码/重置密码</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="res/layui/css/layui.css">
  <link rel="stylesheet" href="res/css/global.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img th:src="${index[0].blogLogo}" alt="layui" width="200" height="40">
    </a>
    <ul class="layui-nav fly-nav-user">
      <!-- 未登入的状态 -->
      <shiro:guest>
        <li class="layui-nav-item">
          <a class="iconfont icon-touxiang layui-hide-xs" href="user"></a>
        </li>
        <li class="layui-nav-item">
          <a href="user">登入</a>
        </li>
        <li class="layui-nav-item">
          <a href="user/userregist">注册</a>
        </li>
      </shiro:guest>
    </ul>
  </div>
</div>

<div class="layui-container fly-marginTop">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title">
        <li><a href="user">登入</a></li>
        <li class="layui-this">找回密码<!--重置密码--></li>
      </ul>
      <div class="layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <div class="layui-form layui-form-pane">
            <div class="layui-form ">
              <div class="layui-form-item">
                <label for="LAY-user-login-username" class="layui-form-label">原用户名</label>
                <div class="layui-input-inline">
                  <input type="text" name="userName" id="LAY-user-login-username" placeholder="原用户名" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="LAY-user-login-cellphone" class="layui-form-label">原手机号</label>
                <div class="layui-input-inline">
                  <input type="text" name="userPhone" id="LAY-user-login-cellphone" lay-verify="phone" placeholder="原手机号" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" alert="1" lay-submit lay-filter="LAY-user-reg-submit">下一步</button>
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
  </div>

  
</div>
<footer th:replace="footer::header-fragment"></footer>
<script src="res/layui/layui.js"></script>
<script src="layuiadmin/layui/lay/modules/jquery.js"></script>
<script>
  layui.config({
    base: 'layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'user'], function(){
  var $ = layui.$
          ,form = layui.form
          ,router = layui.router();

  form.render();

  //提交
  form.on('submit(LAY-user-reg-submit)', function(obj){
    var field = obj.field;
    //请求接口
    $.post('user/findUserName',{
      "userName":field.userName,
      "userPhone":field.userPhone
    },function (res){
      if (res.success){
        layer.msg('查询成功', {
          offset: '15px'
          ,icon: 1
          ,time: 1000
        }, function(){
          location.href = 'user/reset'; //跳转到登入页
        });
      }else {
        layer.msg('未找到您的用户！', {
          offset: '15px'
          ,icon: 1
          ,time: 1000
        });
      }
    },'json');

    return false;
  });
});
</script>

</body>
</html>